/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.univalle.modelo;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Jhony
 */
@Entity
@Table(name = "perfiles")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Perfiles.findAll", query = "SELECT p FROM Perfiles p"),
    @NamedQuery(name = "Perfiles.findByNombrePerfil", query = "SELECT p FROM Perfiles p WHERE p.nombrePerfil = :nombrePerfil"),
    @NamedQuery(name = "Perfiles.findByCrear", query = "SELECT p FROM Perfiles p WHERE p.crear = :crear"),
    @NamedQuery(name = "Perfiles.findByConsultar", query = "SELECT p FROM Perfiles p WHERE p.consultar = :consultar"),
    @NamedQuery(name = "Perfiles.findByModificar", query = "SELECT p FROM Perfiles p WHERE p.modificar = :modificar"),
    @NamedQuery(name = "Perfiles.findByEliminar", query = "SELECT p FROM Perfiles p WHERE p.eliminar = :eliminar")})
public class Perfiles implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2147483647)
    @Column(name = "nombre_perfil")
    private String nombrePerfil;
    @Column(name = "crear")
    private Boolean crear;
    @Column(name = "consultar")
    private Boolean consultar;
    @Column(name = "modificar")
    private Boolean modificar;
    @Column(name = "eliminar")
    private Boolean eliminar;
    @OneToMany(mappedBy = "perfil")
    private List<Empleado> empleadoList;

    public Perfiles() {
    }

    public Perfiles(String nombrePerfil) {
        this.nombrePerfil = nombrePerfil;
    }

    public String getNombrePerfil() {
        return nombrePerfil;
    }

    public void setNombrePerfil(String nombrePerfil) {
        this.nombrePerfil = nombrePerfil;
    }

    public Boolean getCrear() {
        return crear;
    }

    public void setCrear(Boolean crear) {
        this.crear = crear;
    }

    public Boolean getConsultar() {
        return consultar;
    }

    public void setConsultar(Boolean consultar) {
        this.consultar = consultar;
    }

    public Boolean getModificar() {
        return modificar;
    }

    public void setModificar(Boolean modificar) {
        this.modificar = modificar;
    }

    public Boolean getEliminar() {
        return eliminar;
    }

    public void setEliminar(Boolean eliminar) {
        this.eliminar = eliminar;
    }

    @XmlTransient
    public List<Empleado> getEmpleadoList() {
        return empleadoList;
    }

    public void setEmpleadoList(List<Empleado> empleadoList) {
        this.empleadoList = empleadoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nombrePerfil != null ? nombrePerfil.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Perfiles)) {
            return false;
        }
        Perfiles other = (Perfiles) object;
        if ((this.nombrePerfil == null && other.nombrePerfil != null) || (this.nombrePerfil != null && !this.nombrePerfil.equals(other.nombrePerfil))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "co.edu.univalle.modelo.Perfiles[ nombrePerfil=" + nombrePerfil + " ]";
    }
    
}
